<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use app\common\model\Feed as FeedModel;

class Feed extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = 'pet';


    public function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {

        try {
            $feedList = FeedModel::where('status', 'normal')->order('id desc')-> paginate($this->limit);
        } catch (\Exception $th) {
            //throw $th;
            $this->error($th->getMessage());
        }


        return $this->view->fetch('',[
            'title' =>  '喂养技巧',
            'feedList'  =>  $feedList
        ]);
    }

}
